package space.xxhui.javatts.base.utils;


import space.xxhui.javatts.base.constants.ProjResponseCode;
import space.xxhui.javatts.entity.ProjResponse;

/**
 * @author HitvzByHui
 * date 2019-05-03
 */
public class ProjResponseUtils {

    public static <T> ProjResponse<T> defaultSuccess(T data){
        return new ProjResponse(data);
    }

    public static <T> ProjResponse<T> defaultError(T data){
        return new ProjResponse(true, ProjResponseCode.FAILURE,"FAILURE",data);
    }

    public static <T> ProjResponse<T> error(int code,T data){
        return new ProjResponse(true, code,"FAILURE",data);
    }

}
